<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="步骤1：sys_rman初始化配置">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="kingbase-00008.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
<meta name="DC.Publisher" content="20240320">
<meta name="prodname" content="csbs">
<meta name="documenttype" content="usermanual">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="ZH-CN_TOPIC_0000002015631765">
<meta name="DC.Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>步骤1：sys_rman初始化配置</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="ZH-CN_TOPIC_0000002015631765"></a><a name="ZH-CN_TOPIC_0000002015631765"></a>

<h1 class="topictitle1">步骤1：sys_rman初始化配置</h1>
<div><p>从1.5.0升级到1.6.0版本以及使用1.5.0版本产生的副本进行恢复后再首次进行备份或进行主备切换后需要进行sys_rman初始化配置操作，否则将无法执行备份与恢复。</p>
<div class="section"><h4 class="sectiontitle">操作步骤</h4><p><strong>单机初始化</strong></p>
<ol><li><span>登录Kingbase实例所在主机。</span></li><li><span>执行以下命令，查看Kingbase数据库安装目录和数据目录。</span><p><pre class="screen">ps -ef | grep kingbase</pre>
<p>回显如下图所示：</p>
<p><span><img src="zh-cn_image_0000001979761660.png"></span></p>
</p></li><li><span>执行以下命令修改kingbase.conf文件。</span><p><pre class="screen">vi /<em>数据目录</em>/kingbase.conf
archive_mode = on
archive_command = ''</pre>
</p></li><li><span>执行以下命令重新加载Kingbase配置，以数据库安装用户名<strong>k</strong><strong>ingbase</strong>为例。</span><p><pre class="screen">su - <em>kingbase</em>
/<em>安装目录</em>/bin/sys_ctl reload -D /<em>数据目录</em>
exit</pre>
</p></li><li><span>执行以下命令，在bin/sys_backup.conf文件中配置节点IP地址和数据库安装目录与数据目录。</span><p><pre class="screen">cp /<em>安装目录</em>/share/sys_backup.conf /<em>安装目录</em>/bin/sys_backup.conf
cd /<em>安装目录</em>/bin
vi sys_backup.conf
_target_db_style="single"
_one_db_ip="<em>当前节点IP地址</em>"
_repo_ip="<em>当前节点IP地址</em>"
_single_data_dir="/<em>数据目录</em>"
_single_bin_dir="/<em>安装目录</em>/bin"</pre>
</p></li><li><span>执行以下命令完成初始化，以数据库安装用户名<strong>k</strong><strong>ingbase</strong>为例。</span><p><pre class="screen">su - <em>kingbase</em>
cd /<em>安装目录</em>/bin
./sys_backup.sh init</pre>
</p></li></ol>
<p><strong>集群初始化</strong></p>
<ol><li><span>登录Kingbase实例所在主机。</span></li><li><span>执行以下命令，查看Kingbase数据库安装目录和数据目录。</span><p><pre class="screen">ps -ef | grep kingbase</pre>
<p>回显如下图所示：</p>
<p><span><img src="zh-cn_image_0000002016443885.png"></span></p>
</p></li><li><span>执行以下命令修改主备节点kingbase.conf文件。</span><p><pre class="screen">vi /<em>数据目录</em>/kingbase.conf
archive_mode = on
archive_command=''</pre>
</p></li><li><span>执行以下命令重新加载Kingbase配置，以数据库安装用户名<strong>k</strong><strong>ingbase</strong>为例。</span><p><pre class="screen">su - <em>kingbase</em>
/<em>安装目录</em>/bin/sys_ctl reload -D /<em>数据目录</em>
exit</pre>
</p></li><li><span>执行以下命令，在主备节点bin/sys_backup.conf文件中配置节点IP地址和数据库安装目录与数据目录。</span><p><pre class="screen">cp /<em>安装目录</em>/share/sys_backup.conf /<em>安装目录</em>/bin/sys_backup.conf
cd /<em>安装目录</em>/bin
vi sys_backup.conf
_target_db_style="cluster"
_one_db_ip="<em>当前节点IP地址</em>" 
_repo_ip="<em>当前节点IP地址</em>" 
_single_data_dir="/<em>数据目录</em>"
_single_bin_dir="/<em>安装目录</em>/bin"
_use_scmd=off</pre>
<div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p>步骤1~步骤5需要在主备两个节点执行。</p>
</div></div>
</p></li><li><span>在repo节点执行以下命令完成初始化，以数据库安装用户名<strong>k</strong><strong>ingbase</strong>为例。</span><p><pre class="screen">su - <em>kingbase</em>
cd /<em>安装目录</em>/bin
./sys_backup.sh init</pre>
<div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p>步骤6需要在主节点执行。</p>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>父主题：</strong> <a href="kingbase-00008.html">备份Kingbase实例</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">版权所有 &copy; 华为技术有限公司</div></body>
</html>